<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateGoodsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        //商品信息表
        Schema::create('goods', function(Blueprint $table) {
            $table->increments('id')->comment('自增id');
            $table->string('ssn',20)->nullable()->comment('商品货号');
            $table->string('name',50)->nullable()->comment('商品名称');
            $table->string('model')->nullable()->comment('型号');
            $table->decimal('amount')->default(0)->comment('市场价格');
            $table->integer('coin')->default(0)->comment('波罗币');
            $table->integer('thumb_id')->default(0)->comment('商品缩略图');
            $table->text('info')->nullable()->comment('商品信息描述');
            $table->integer('stock')->default(0)->comment('商品库存');
            $table->integer('type_id')->default(0)->comment('商品大分类id');
            $table->integer('isshop')->default(0)->comment('是否上架，0：否 1：是');
            $table->timestamp('shoptime')->nullable()->comment('上架时间');
            $table->integer('isrecommend')->default(0)->comment('是否推荐，0：否 1：是');
            $table->integer('sale_count')->default(0)->comment('销售数量');
            $table->integer('isnew')->default(0)->comment('是否新品，0：否 1：是');
            $table->integer('sort')->default(0)->comment('商品排序，整数，数字越低排序越前');
            $table->integer('user_id')->default(0)->comment('发布者');
            $table->softDeletes();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
    }
}
